package com.zyy.springbootdata.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zyy.springbootdata.mapper.ArticleMapper;
import com.zyy.springbootdata.pojo.Article;
import com.zyy.springbootdata.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zyy
 * @date 2020/12/20 下午9:13
 * @description
 */
@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    private ArticleMapper articleMapper;
    @Override
    public PageInfo<Article> findList(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Article> articleList = articleMapper.findList();
        PageInfo<Article> pageInfo = new PageInfo<>(articleList);
        return pageInfo;
    }
}
